import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import pkg from './package.json'

export default [
  {
    input: 'src/main.js',
    output: {
      file: pkg.browser,
      format: 'umd',
      globals: {
        leaflet: 'L',
        echarts: 'echarts',
      },
      plugins: [terser()],
    },
    external: ['leaflet', 'echarts'],
    plugins: [resolve(), commonjs()],
  },
]
